#pragma once
#include <vector>
#include "graphics/Renderer.h"
#include "graphics/Texture.h"
#include "graphics/Mesh.h"
#include <string>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include "SDL/SDL.h"
#include "camera/Camera.h"
#include "Object.h"


class Mesh;

class Model:public Object
{
public:
	Model(const std::string& filePath);
	~Model();

	void Update(Camera* camera) override;
	void Draw() override;

	std::vector<Mesh*> m_ModelMeshs;
	std::vector<Renderer*> m_ModelRenderers;

	Vector3 m_ModelPosition;
	Vector3 m_ModelRotation;
	Vector3 m_ModelScale;

	std::string m_ModelDirectory;
private:
	void LoadModel(const std::string& filePath);
	void ProcessNodes(aiNode* node, const aiScene* scene);
	Mesh* ProcessMesh(aiMesh* aimesh, const aiScene* scene);
	std::vector<Texture*> LoadModelTextures(aiMaterial* mat, aiTextureType type);
};

